{% extends './views/layout/layout.html' %}



{% block head %}
<link rel="stylesheet" href="/public/css/list.css" />
{% endblock %}

{% block main %}
<div class="main">
  <div class="container">
    <div class="list-box">
      <div class="h">
        <h2 class="title">{{category.name}}</h2>
      </div>
      <div class="c clearfix">
        <ul class="list clearfix">
          {% for item in items %}
          <li class="item">
            <div class="figure">
              <a href="/detail/{{item.id}}">
                <img src="/public/images/{{item.cover}}" alt="" />
              </a>
            </div>
            <h3 class="title">
              <a href="/detail/{{item.id}}"> {{item.name}} </a>
              <p class="price"><span class="num">{{item.price}}</span>元</p>
            </h3>
            <p class="desc">{{item.description}}</p>
          </li>
          {%endfor%}
        </ul>
      </div>
    </div>

    <div class="container">
      {#
      <div class="pagination">
        <a href="/list/{{category.id}}?pageNum=1&pageSize=4">首页</a>
        {% if pageNum > 1 %}
        <a href="/list/{{category.id}}?pageNum={{pageNum-1}}&pageSize=4">&lt;</a>
        {%endif%}
        {% for i in range(0,count/pageSize)%}
        <a href="/list/{{category.id}}?pageNum={{i+1}}&pageSize=4" class="current">{{i+1}}</a>
        {% endfor %}
        {% if pageNum <= count /pageSize %} <a href="/list/{{category.id}}?pageNum={{pageNum+1}}&pageSize=4">
          &gt;</a>
          {%endif%}
          <a href="/list/{{category.id}}?pageNum={{(count/pageSize)|round(0,'ceil')}}&pageSize=4">尾页</a>
      </div> #}
    </div>
  </div>
</div>
{% endblock %}
